from django.conf.urls import url,include
from . import views,cartviews

urlpatterns = [
    # 商品　首页
    url(r'^$',views.index,name='myhome_index'),
    # 商品　列表页    
    url(r'^list/(?P<yid>[0-9]+)/$',views.goodslist,name='myhome_goodslist'),
    # 商品　详情页    
    url(r'^onegoods/(?P<gid>[0-9]+)/$',views.onegoods,name='myhome_onegoods'),
    # 登录    
    url(r'^login/$',views.login,name='myhome_login'),
    # 退出登陆
    url(r'^logout/$',views.logout,name='myhome_logout'),
    # 注册
    url(r'^register/$',views.register,name='myhome_register'),
    # 验证码    
    url(r'^verifycode/$',views.verifycode,name='myhome_verifycode'),
    

    # 加入购物车
    url(r'^cartadd/$',cartviews.cartadd,name='myhome_cartadd'),
    # 购物车页面
    url(r'^cartindex/$',cartviews.cartindex,name='myhome_cartindex'),
    # 清空购物车
    url(r'^cartclear/$',cartviews.cartclear,name='myhome_cartclear'),

    # 购物车删除商品
    url(r'^cardelete/(?P<gid>[0-9]+)/$',cartviews.cardelete,name='myhome_cardelete'),
    # 添加 减少 商品
    url(r'^cartedit/$',cartviews.cartedit,name='myhome_cartedit'),


    # 确认订单
    url(r'^order/confirm/$',cartviews.orderconfirm,name='myhome_orderconfirm'),
    # 添加收货地址
    url(r'^address/insert/$',cartviews.addressinsert,name='myhome_addressinsert'),
    # 生成订单
    url(r'^order/create/$',cartviews.ordercreate,name='myhome_ordercreate'),

    # 支付页面
    url(r'^order/buy/(?P<oid>[0-9]+)/$',cartviews.orderbuy,name='myhome_orderbuy'),
    # 支付成功
    url(r'^order/buy/success/(?P<oid>[0-9]+)/$',cartviews.orderbuysuccess,name='myhome_orderbuysuccess'),
    # 取消支付quxiaozhifu
    url(r'^order/buy/quxiaozhifu/(?P<oid>[0-9]+)/$',cartviews.quxiaozhifu,name='myhome_quxiaozhifu'),



    #  个人中心,我的订单
    url(r'^myorder/$',cartviews.myorder,name='myhome_myorder'),
    # 个人中心,地址管理
    url(r'^myorder/dizhi/$',cartviews.dizhi,name='myhome_dizhi'),
    # 个人中心,个人信息
    url(r'^myorder/xinxi/$',cartviews.xinxi,name='myhome_xinxi'),
    # 个人中心,个人信息修改
    url(r'^myorder/xinxi/xiugai$',cartviews.xinxixiugai,name='myhome_xinxixiugai'),
# 个人中心,个人信息更新
    url(r'^myorder/xinxi/gengxin$',cartviews.xinxigengxin,name='myhome_xinxigengxin'),

    # 短信验证
    url(r'^sendmsg/$',  views.sendmsg,name="sendmsg"),
    


]